1. Field of the Invention
The present invention relates to a program and apparatus which draw and display graphical objects in a three-dimensional virtual space, and more particularly to a program and apparatus which draw and display graphical objects in a motion video according to a user-specified eye point and direction parameters.
2. Description of the Related Art
Computer graphics technologies have enabled us to construct a virtual environment within a computer system by arranging many graphical objects in a three-dimensional virtual space. Such graphical objects are created with a three-dimensional computer-aided design (CAD) system or similar tools, and the user can view the images of those objects on a computer monitor screen, from various viewpoints and angles.
Technically, to realize a simulated environment, an X-Y-Z virtual space is defined in a computer to accommodate one or more graphical objects. This virtual space is oriented to an appropriate direction, depending on the purpose of simulation. When simulating, for example, a city street environment, the positive Z-axis direction of the space is supposed to match with the direction against gravity in our real world. An eye point is then defined in such a virtual space, and a projection plane is set to a certain place between the eye point and objects to be viewed. The projection plane corresponds to a computer screen that the user is watching, on which the images of graphical objects are projected. The orientation of the projection plane is specified as a vector directing to the plane""s upward direction, hence the name xe2x80x9cup vector.xe2x80x9d
FIG. 19 shows a conventional modeling of a three-dimensional virtual space. Arranged in the illustrated virtual space are: an eye point 501, an object 502, and a projection plane 503. Line-of-sight vector V is defined as a vector extending from the eye point 501 toward the object 502. The projection plane 503 is located between the eye point 501 and object 502, the upward direction of which is determined by an up vector U. By definition, the up vector U is perpendicular to the line-of-sight vector V. Since the up vector U is not restricted to any particular direction in the virtual space, the user is allowed to view the object 502 from any angles by manipulating the line-of-sight vector V and up vector U. For example, the user can even get an up-side-down view of the object 502 by reversing the direction of the up vector U. This flexibility serves as a very effective tool for mechanical engineering, in which designers need to review a component or workpiece on a computer monitor screen from various directions.
In most situations in the real world, as opposed to virtual environments, our eye sight is oriented vertically (i.e., we all assume that the direction opposite to gravity is our default xe2x80x9cup directionxe2x80x9d). In other words, the up vector in our real life is almost fixed to the direction against gravity. This fact justifies having the up vector U fixed to the upward direction (or Z-axis) of the three-dimensional virtual space in realizing a walk-through animation which simulates an environment we ordinarily see in real life. Such a vertically fixed setup of the projection plane prevents the object 502 from looking as if it were inverted or tilted, and in ordinary city street simulations, the viewers would feel this fixed setup comfortable and usable, even though they are not allowed to look up at the sky or look down at the ground.
As explained above, conventional object displaying programs have their own algorithms to determine an up vector, depending on the purpose of the programs. When the user needs, for example, to view a single object from various directions, the program defines such an up vector that is perpendicular to the line-of-sight vector. When the user wishes to walk through a virtual street, the program uses an up vector being set in a vertical direction of the virtual environment.
In the real world, however, people often change their way of seeing objects, and this change happens even in a continuous series of actions. Suppose, for example, such a situation where a person is walking in a house in an attempt to find and enter to a particular room. At the first stage, he/she has a broader interest about the environment, including the route to the destination. When he/she has reached the destination and entered the room, the person""s interest may then be turned to a particular object he/she finds in the room. Now he/she may wish to check the shape of that object by viewing it from different directions. To simulate the above scenes continuously in a three-dimensional virtual space, the object displaying program or system has to be more flexible in redefining the up vector.
The conventional programs or systems, however, fail to provide flexibility; they only allow the user to define the up vector in a predetermined way. One program offers an up vector in a vertical direction of the three-dimensional virtual space. This would be fine when the user walks around in the virtual space, since it is close to his/her familiar world where a direction opposite to the gravity is the inherent up direction. However, with the same up vector, the user would not be able to check a particular object from multiple viewpoints. While an up vector perpendicular to the line-of-sight vector is suitable for the latter purpose, this type of up vector definition is not preferable when the user needs a wider scope so as to check, for example, the entire room containing objects.
In view of the foregoing, it is an object of the present invention to provide an object displaying program or apparatus which permits the user to change the up direction of the projection plane flexibly in a real time fashion while viewing a motion video.
To accomplish the above object, according to the present invention, there is provided a computer program product which draws and displays an image of given objects in a three-dimensional virtual space. When executed on a computer system, this program performs the following processing steps: (a) determining which movement mode to use, according to a given user action; (b) calculating eye point coordinates and a line-of-sight vector, according to the given user action and the determined movement mode; (c) when the determined movement mode is fixed up-direction mode, setting an up direction of a projection plane to a predetermined direction; (d) when the determined movement mode is variable up-direction mode, determining the up direction of the projection plane according to predetermined rules; (e) performing a perspective transformation of the given objects onto the projection plane being oriented to the determined up direction, based on the determined eye point coordinates and line-of-sight vector, thereby creating an image of the given objects; and (f) displaying the created image.
Further, to accomplish the above object, the present invention provides an apparatus for drawing and displaying an image of given objects in a three-dimensional virtual space. This apparatus comprises the following elements: (a) a movement mode manager which determining which movement mode to use, according to a given user action; (b) an eye point manager which calculates eye point coordinates and a line-of-sight vector, according to the given user action and the determined movement mode; (c) an up direction manager which sets the up direction of a projection plane to a predetermined direction when the determined movement mode is fixed up-direction mode, and determines the up direction according to predetermined rules when the determined movement mode is variable up-direction mode; (d) a drawing processor which performs a perspective transformation of the given objects onto the projection plane being oriented to the determined up direction, based on the determined eye point coordinates and line-of-sight vector, thereby creating an image of the given objects; and (e) a display processor which displays the image created by the drawing processor.
The above and other objects, features and advantages of the present invention will become apparent from the following description when taken in conjunction with the accompanying drawings which illustrate preferred embodiments of the present invention by way of example.